@layout("/common/_container1.html"){
<div class="ibox float-e-margins">
    <div class="ibox-content" style="height: 463px;">
        @if(isEmpty(crList)){
        <div class="prompt">
        </div>
        <div class="prompt_text">
            没有相关教室呦!
        </div>
        @}
        @else if(isNotEmpty(crList)){
        <div class="form-horizontal" id="announcementInfoForm">

            <div class="row">
                <input type="hidden" value="${classId}" name="classId" id="classId">
                <div class="col-sm-12 b-r">
                    <#select id="classroomTypeId" name="教室类型" underline="true" onchange="selectCr(this)">
                    <option value="">请选择</option>
                    <option value="1">普通教室</option>
                    <option value="2">专业教室</option>
                    <option value="3">功能教室</option>
                    <option value="4">公用教室</option>
                </#select>
                <#select id="classroomId" name="所处教室" underline="true" span="true">
            </#select>

            </div>
        </div>

        <div class="row btn-group-m-t">
            <div class="col-sm-10" style="text-align: right;margin-top: 100px">
                <#button btnCss="info" name="保存" id="ensure" icon="fa-paper-plane" clickFun="PtClassInfoDlg.addToClass()"/>
                <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="PtClassInfoDlg.close()"/>
            </div>
        </div>
    </div>
    @}
</div>
<script src="${ctxPath}/static/modular/system/ptClass/ptClass_info.js"></script>
<style>
    .prompt_text{
        margin: 0 auto;
        width: 448px;
        text-align: center;
        font-size: 18px;
        font-family: “Microsoft YaHei”;
        overflow: hidden;
    }
    .prompt{
        width: 136px;
        height: 150px;
        background: url("../static/img/boy.gif") no-repeat;
        margin: 0 auto;
        margin-top: 50px;
        background-size: 75%;
        background-position: center;
    }
</style>
<script>
    function selectCr(){
        var crList;
        var type = $.trim($("#classroomTypeId").val());
        $.ajax({
            type:"post",
            async:false,
            url:Feng.ctxPath+"/ptSchoolClassroom/listCrByType?isUsed=0",
            data:{'classroomTypeId':type,'orgId':'${orgId}'},
            dataType:"json",
            cache: false,
            success: function(data){
                crList = data.data;
                if(crList){
                    backfunc(crList);
                }else{
                    $("#classroomId").empty();
                    $("#classroomId").append("<option>"+"暂无教室"+"</option>");
                }
            },
        });
    }
    function backfunc(crList) {

        $("#classroomId").empty();
        $.each(crList,function(index,item){
            $("#classroomId").append("<option value="+item.id+">"+item.buildingName+item.name+"</option>");
        })
        /*}*/

    }
</script>
@}
